﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Microsoft.WindowsAzure;

namespace WebRole1
{
    public partial class Default : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        private CloudStorageAccount getaccount()
        {
            return CloudStorageAccount.Parse(CloudConfigurationManager.GetSetting("MyConnectionString"));
        }

        protected void Submit_Click(object sender, EventArgs e)
        {
            try
            {
                TContext t = new TContext(getaccount().TableEndpoint.AbsoluteUri.ToString(),getaccount().Credentials);
                t.addUser(Email_Bx.Text, Name_Bx.Text);
            }
            catch
            {
                Error_Bx.Text = "Error";
            }
        }
    }
}